package com.mobclick.android;

import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Handler;
import android.os.HandlerThread;
import android.util.Log;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import javax.microedition.khronos.opengles.GL10;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class MobclickAgent
{
  private static final String A = "time";
  private static final String B = "start_millis";
  private static final String C = "end_millis";
  private static final String D = "duration";
  private static final String E = "activities";
  private static final String F = "header";
  private static final String G = "package";
  public static String GPU_RENDERER;
  public static String GPU_VENDER;
  private static final String H = "sdk_version";
  private static final String I = "channel";
  private static final String J = "idmd5";
  private static final String K = "version_code";
  private static final String L = "acc";
  private static final String M = "tag";
  private static final String N = "label";
  private static final String O = "context";
  private static final String P = "last_config_time";
  private static final String Q = "report_policy";
  private static final String R = "update_internal";
  private static final String S = "online_params";
  private static final MobclickAgent a = new MobclickAgent();
  private static int b = 0;
  private static final int e = 0;
  private static final int f = 1;
  private static final int g = 2;
  private static final int h = 3;
  private static UmengUpdateListener i = null;
  private static UmengOnlineConfigureListener j = null;
  private static JSONObject k;
  private static final String l = "type";
  private static final String m = "subtype";
  public static boolean mUpdateOnlyWifi = 0;
  public static boolean mUseLocationService = 0;
  private static final String n = "update";
  private static final String o = "error";
  private static final String p = "event";
  private static final String q = "launch";
  private static final String r = "flush";
  private static final String s = "terminate";
  private static final String t = "online_config";
  private static final String u = "cache_error";
  public static boolean updateAutoPopup = 0;
  private static final String v = "send_error";
  private static final String w = "appkey";
  private static final String x = "body";
  private static final String y = "session_id";
  private static final String z = "date";
  private Context c;
  private final Handler d;

  static
  {
    GPU_VENDER = "";
    GPU_RENDERER = "";
    mUpdateOnlyWifi = true;
    mUseLocationService = true;
    k = null;
    updateAutoPopup = true;
  }

  private MobclickAgent()
  {
    HandlerThread localHandlerThread = new HandlerThread("MobclickAgent");
    localHandlerThread.start();
    this.d = new Handler(localHandlerThread.getLooper());
  }

  static SharedPreferences a(Context paramContext)
  {
    String str = paramContext.getPackageName();
    return paramContext.getSharedPreferences("mobclick_agent_user_" + str, 0);
  }

  private String a(Context paramContext, SharedPreferences paramSharedPreferences)
  {
    Long localLong = Long.valueOf(System.currentTimeMillis());
    SharedPreferences.Editor localEditor = paramSharedPreferences.edit();
    localEditor.putLong("start_millis", localLong.longValue());
    localEditor.putLong("end_millis", -1L);
    localEditor.commit();
    return paramSharedPreferences.getString("session_id", null);
  }

  private String a(Context paramContext, String paramString, long paramLong)
  {
    StringBuilder localStringBuilder = new StringBuilder();
    localStringBuilder.append(paramLong).append(paramString).append(t.d(paramContext));
    return t.a(localStringBuilder.toString(), false);
  }

  private String a(Context paramContext, String paramString, SharedPreferences paramSharedPreferences)
  {
    c(paramContext, paramSharedPreferences);
    long l1 = System.currentTimeMillis();
    String str = a(paramContext, paramString, l1);
    SharedPreferences.Editor localEditor = paramSharedPreferences.edit();
    localEditor.putString("appkey", paramString);
    localEditor.putString("session_id", str);
    localEditor.putLong("start_millis", l1);
    localEditor.putLong("end_millis", -1L);
    localEditor.putLong("duration", 0L);
    localEditor.putString("activities", "");
    localEditor.commit();
    b(paramContext, paramSharedPreferences);
    return str;
  }

  // ERROR //
  private static String a(Context paramContext, JSONObject paramJSONObject, String paramString1, boolean paramBoolean, String paramString2)
  {
    // Byte code:
    //   0: new 277	org/apache/http/client/methods/HttpPost
    //   3: dup
    //   4: aload_2
    //   5: invokespecial 278	org/apache/http/client/methods/HttpPost:<init>	(Ljava/lang/String;)V
    //   8: astore 5
    //   10: new 280	org/apache/http/params/BasicHttpParams
    //   13: dup
    //   14: invokespecial 281	org/apache/http/params/BasicHttpParams:<init>	()V
    //   17: astore 6
    //   19: aload 6
    //   21: sipush 10000
    //   24: invokestatic 287	org/apache/http/params/HttpConnectionParams:setConnectionTimeout	(Lorg/apache/http/params/HttpParams;I)V
    //   27: aload 6
    //   29: sipush 30000
    //   32: invokestatic 290	org/apache/http/params/HttpConnectionParams:setSoTimeout	(Lorg/apache/http/params/HttpParams;I)V
    //   35: new 292	org/apache/http/impl/client/DefaultHttpClient
    //   38: dup
    //   39: aload 6
    //   41: invokespecial 295	org/apache/http/impl/client/DefaultHttpClient:<init>	(Lorg/apache/http/params/HttpParams;)V
    //   44: astore 7
    //   46: aload_0
    //   47: invokestatic 299	com/mobclick/android/u:a	(Landroid/content/Context;)Ljava/lang/String;
    //   50: astore 13
    //   52: aload 13
    //   54: ifnull +34 -> 88
    //   57: new 301	org/apache/http/HttpHost
    //   60: dup
    //   61: aload 13
    //   63: bipush 80
    //   65: invokespecial 304	org/apache/http/HttpHost:<init>	(Ljava/lang/String;I)V
    //   68: astore 14
    //   70: aload 7
    //   72: invokeinterface 310 1 0
    //   77: ldc_w 312
    //   80: aload 14
    //   82: invokeinterface 318 3 0
    //   87: pop
    //   88: aload_1
    //   89: invokevirtual 321	org/json/JSONObject:toString	()Ljava/lang/String;
    //   92: astore 16
    //   94: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   97: ifeq +11 -> 108
    //   100: ldc 166
    //   102: aload 16
    //   104: invokestatic 331	android/util/Log:i	(Ljava/lang/String;Ljava/lang/String;)I
    //   107: pop
    //   108: getstatic 334	com/mobclick/android/UmengConstants:COMPRESS_DATA	Z
    //   111: ifeq +212 -> 323
    //   114: iload_3
    //   115: ifne +208 -> 323
    //   118: new 192	java/lang/StringBuilder
    //   121: dup
    //   122: ldc_w 336
    //   125: invokespecial 195	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   128: aload 16
    //   130: invokevirtual 199	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   133: invokevirtual 202	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   136: invokestatic 339	com/mobclick/android/t:a	(Ljava/lang/String;)[B
    //   139: astore 29
    //   141: aload 5
    //   143: ldc_w 341
    //   146: ldc_w 343
    //   149: invokevirtual 347	org/apache/http/client/methods/HttpPost:addHeader	(Ljava/lang/String;Ljava/lang/String;)V
    //   152: aload 5
    //   154: new 349	org/apache/http/entity/InputStreamEntity
    //   157: dup
    //   158: new 351	java/io/ByteArrayInputStream
    //   161: dup
    //   162: aload 29
    //   164: invokespecial 354	java/io/ByteArrayInputStream:<init>	([B)V
    //   167: getstatic 355	com/mobclick/android/t:b	I
    //   170: i2l
    //   171: invokespecial 358	org/apache/http/entity/InputStreamEntity:<init>	(Ljava/io/InputStream;J)V
    //   174: invokevirtual 362	org/apache/http/client/methods/HttpPost:setEntity	(Lorg/apache/http/HttpEntity;)V
    //   177: aload_0
    //   178: invokestatic 364	com/mobclick/android/MobclickAgent:i	(Landroid/content/Context;)Landroid/content/SharedPreferences;
    //   181: invokeinterface 226 1 0
    //   186: astore 19
    //   188: new 366	java/util/Date
    //   191: dup
    //   192: invokespecial 367	java/util/Date:<init>	()V
    //   195: astore 20
    //   197: aload 7
    //   199: aload 5
    //   201: invokeinterface 371 2 0
    //   206: astore 21
    //   208: new 366	java/util/Date
    //   211: dup
    //   212: invokespecial 367	java/util/Date:<init>	()V
    //   215: invokevirtual 374	java/util/Date:getTime	()J
    //   218: aload 20
    //   220: invokevirtual 374	java/util/Date:getTime	()J
    //   223: lsub
    //   224: lstore 22
    //   226: aload 21
    //   228: invokeinterface 380 1 0
    //   233: invokeinterface 386 1 0
    //   238: sipush 200
    //   241: if_icmpne +168 -> 409
    //   244: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   247: ifeq +26 -> 273
    //   250: ldc 166
    //   252: new 192	java/lang/StringBuilder
    //   255: dup
    //   256: ldc_w 388
    //   259: invokespecial 195	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   262: aload_2
    //   263: invokevirtual 199	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   266: invokevirtual 202	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   269: invokestatic 331	android/util/Log:i	(Ljava/lang/String;Ljava/lang/String;)I
    //   272: pop
    //   273: aload 19
    //   275: ldc_w 390
    //   278: lload 22
    //   280: invokeinterface 235 4 0
    //   285: pop
    //   286: aload 19
    //   288: invokeinterface 241 1 0
    //   293: pop
    //   294: aload 21
    //   296: invokeinterface 394 1 0
    //   301: astore 27
    //   303: aload 27
    //   305: ifnull +98 -> 403
    //   308: aload 27
    //   310: invokeinterface 400 1 0
    //   315: invokestatic 403	com/mobclick/android/MobclickAgent:a	(Ljava/io/InputStream;)Ljava/lang/String;
    //   318: astore 9
    //   320: goto +136 -> 456
    //   323: new 405	java/util/ArrayList
    //   326: dup
    //   327: iconst_1
    //   328: invokespecial 408	java/util/ArrayList:<init>	(I)V
    //   331: astore 17
    //   333: aload 17
    //   335: new 410	org/apache/http/message/BasicNameValuePair
    //   338: dup
    //   339: ldc_w 412
    //   342: aload 16
    //   344: invokespecial 414	org/apache/http/message/BasicNameValuePair:<init>	(Ljava/lang/String;Ljava/lang/String;)V
    //   347: invokeinterface 420 2 0
    //   352: pop
    //   353: aload 5
    //   355: new 422	org/apache/http/client/entity/UrlEncodedFormEntity
    //   358: dup
    //   359: aload 17
    //   361: ldc_w 424
    //   364: invokespecial 427	org/apache/http/client/entity/UrlEncodedFormEntity:<init>	(Ljava/util/List;Ljava/lang/String;)V
    //   367: invokevirtual 362	org/apache/http/client/methods/HttpPost:setEntity	(Lorg/apache/http/HttpEntity;)V
    //   370: goto -193 -> 177
    //   373: astore 11
    //   375: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   378: ifeq +19 -> 397
    //   381: ldc 166
    //   383: ldc_w 429
    //   386: aload 11
    //   388: invokestatic 432	android/util/Log:i	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    //   391: pop
    //   392: aload 11
    //   394: invokevirtual 435	org/apache/http/client/ClientProtocolException:printStackTrace	()V
    //   397: aconst_null
    //   398: astore 9
    //   400: goto +56 -> 456
    //   403: aconst_null
    //   404: astore 9
    //   406: goto +50 -> 456
    //   409: aload 19
    //   411: ldc_w 390
    //   414: ldc2_w 236
    //   417: invokeinterface 235 4 0
    //   422: pop
    //   423: aconst_null
    //   424: astore 9
    //   426: goto +30 -> 456
    //   429: astore 8
    //   431: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   434: ifeq +19 -> 453
    //   437: ldc 166
    //   439: ldc_w 437
    //   442: aload 8
    //   444: invokestatic 432	android/util/Log:i	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    //   447: pop
    //   448: aload 8
    //   450: invokevirtual 438	java/io/IOException:printStackTrace	()V
    //   453: aconst_null
    //   454: astore 9
    //   456: aload 9
    //   458: areturn
    //
    // Exception table:
    //   from	to	target	type
    //   46	370	373	org/apache/http/client/ClientProtocolException
    //   409	423	373	org/apache/http/client/ClientProtocolException
    //   46	370	429	java/io/IOException
    //   409	423	429	java/io/IOException
  }

  // ERROR //
  private static String a(java.io.InputStream paramInputStream)
  {
    // Byte code:
    //   0: new 440	java/io/BufferedReader
    //   3: dup
    //   4: new 442	java/io/InputStreamReader
    //   7: dup
    //   8: aload_0
    //   9: invokespecial 445	java/io/InputStreamReader:<init>	(Ljava/io/InputStream;)V
    //   12: sipush 8192
    //   15: invokespecial 448	java/io/BufferedReader:<init>	(Ljava/io/Reader;I)V
    //   18: astore_1
    //   19: new 192	java/lang/StringBuilder
    //   22: dup
    //   23: invokespecial 247	java/lang/StringBuilder:<init>	()V
    //   26: astore_2
    //   27: aload_1
    //   28: invokevirtual 451	java/io/BufferedReader:readLine	()Ljava/lang/String;
    //   31: astore 11
    //   33: aload 11
    //   35: ifnonnull +16 -> 51
    //   38: aload_0
    //   39: invokevirtual 456	java/io/InputStream:close	()V
    //   42: aload_2
    //   43: invokevirtual 202	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   46: astore 5
    //   48: aload 5
    //   50: areturn
    //   51: aload_2
    //   52: new 192	java/lang/StringBuilder
    //   55: dup
    //   56: aload 11
    //   58: invokestatic 461	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   61: invokespecial 195	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   64: ldc_w 463
    //   67: invokevirtual 199	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   70: invokevirtual 202	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   73: invokevirtual 199	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   76: pop
    //   77: goto -50 -> 27
    //   80: astore 7
    //   82: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   85: ifeq +19 -> 104
    //   88: ldc 166
    //   90: ldc_w 465
    //   93: aload 7
    //   95: invokestatic 467	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    //   98: pop
    //   99: aload 7
    //   101: invokevirtual 438	java/io/IOException:printStackTrace	()V
    //   104: aload_0
    //   105: invokevirtual 456	java/io/InputStream:close	()V
    //   108: aconst_null
    //   109: astore 5
    //   111: goto -63 -> 48
    //   114: astore 8
    //   116: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   119: ifeq +19 -> 138
    //   122: ldc 166
    //   124: ldc_w 465
    //   127: aload 8
    //   129: invokestatic 467	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    //   132: pop
    //   133: aload 8
    //   135: invokevirtual 438	java/io/IOException:printStackTrace	()V
    //   138: aconst_null
    //   139: astore 5
    //   141: goto -93 -> 48
    //   144: astore_3
    //   145: aload_0
    //   146: invokevirtual 456	java/io/InputStream:close	()V
    //   149: aload_3
    //   150: athrow
    //   151: astore 4
    //   153: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   156: ifeq +19 -> 175
    //   159: ldc 166
    //   161: ldc_w 465
    //   164: aload 4
    //   166: invokestatic 467	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    //   169: pop
    //   170: aload 4
    //   172: invokevirtual 438	java/io/IOException:printStackTrace	()V
    //   175: aconst_null
    //   176: astore 5
    //   178: goto -130 -> 48
    //   181: astore 13
    //   183: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   186: ifeq +19 -> 205
    //   189: ldc 166
    //   191: ldc_w 465
    //   194: aload 13
    //   196: invokestatic 467	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
    //   199: pop
    //   200: aload 13
    //   202: invokevirtual 438	java/io/IOException:printStackTrace	()V
    //   205: aconst_null
    //   206: astore 5
    //   208: goto -160 -> 48
    //
    // Exception table:
    //   from	to	target	type
    //   27	33	80	java/io/IOException
    //   51	77	80	java/io/IOException
    //   104	108	114	java/io/IOException
    //   27	33	144	finally
    //   51	77	144	finally
    //   82	104	144	finally
    //   145	149	151	java/io/IOException
    //   38	42	181	java/io/IOException
  }

  private JSONArray a(JSONObject paramJSONObject, JSONArray paramJSONArray)
  {
    while (true)
    {
      while (true)
      {
        int i1;
        do
        {
          String str1;
          try
          {
            str1 = paramJSONObject.getString("tag");
            if (!(paramJSONObject.has("label")))
              break label275;
            str2 = paramJSONObject.getString("label");
            String str3 = paramJSONObject.getString("date");
            i1 = paramJSONArray.length() - 1;
            break label258:
            while (true)
            {
              JSONObject localJSONObject;
              while (true)
              {
                if (i2 != 0)
                  break label269;
                paramJSONArray.put(paramJSONObject);
                break label269:
                localJSONObject = (JSONObject)paramJSONArray.get(i1);
                if ((str2 != null) || (localJSONObject.has("label")))
                  break;
                if ((!(str1.equals(localJSONObject.get("tag")))) || (!(str3.equals(localJSONObject.get("date")))))
                  break label220;
                localJSONObject.put("acc", 1 + localJSONObject.getInt("acc"));
                i2 = 1;
              }
              if ((str2 == null) || (!(localJSONObject.has("label"))) || (!(str1.equals(localJSONObject.get("tag")))) || (!(str2.equals(localJSONObject.get("label")))) || (!(str3.equals(localJSONObject.get("date")))))
                break;
              localJSONObject.put("acc", 1 + localJSONObject.getInt("acc"));
              i2 = 1;
            }
            label258: label220: --i1;
          }
          catch (Exception localException)
          {
            if (UmengConstants.testMode)
            {
              Log.i("MobclickAgent", "custom log merge error in tryToSendMessage");
              localException.printStackTrace();
            }
            paramJSONArray.put(paramJSONObject);
            localJSONArray = paramJSONArray;
            break label272:
          }
        }
        while (i1 >= 0);
        int i2 = 0;
      }
      label269: JSONArray localJSONArray = paramJSONArray;
      label272: return localJSONArray;
      label275: String str2 = null;
    }
  }

  private static void a(Context paramContext, int paramInt)
  {
    if ((paramInt < 0) || (paramInt > 5))
    {
      if (UmengConstants.testMode)
        Log.e("MobclickAgent", "Illegal value of report policy");
      return;
    }
    SharedPreferences localSharedPreferences = n(paramContext);
    synchronized (UmengConstants.saveOnlineConfigMutex)
    {
      localSharedPreferences.edit().putInt("umeng_local_report_policy", paramInt).commit();
    }
  }

  private void a(Context paramContext, SharedPreferences paramSharedPreferences, String paramString1, String paramString2, int paramInt)
  {
    String str1 = paramSharedPreferences.getString("session_id", "");
    String str2 = b();
    String str3 = str2.split(" ")[0];
    String str4 = str2.split(" ")[1];
    JSONObject localJSONObject = new JSONObject();
    try
    {
      localJSONObject.put("type", "event");
      localJSONObject.put("session_id", str1);
      localJSONObject.put("date", str3);
      localJSONObject.put("time", str4);
      localJSONObject.put("tag", paramString1);
      if (paramString2 != null)
        localJSONObject.put("label", paramString2);
      localJSONObject.put("acc", paramInt);
      this.d.post(new s(this, paramContext, localJSONObject));
      return;
    }
    catch (JSONException localJSONException)
    {
      if (!(UmengConstants.testMode));
      Log.i("MobclickAgent", "json error in emitCustomLogReport");
      localJSONException.printStackTrace();
    }
  }

  /**
   * @deprecated
   */
  private void a(Context paramContext, String paramString)
  {
    JSONObject localJSONObject;
    monitorenter;
    try
    {
      localJSONObject = new JSONObject();
    }
    finally
    {
      try
      {
        localJSONObject.put("type", "update");
        localJSONObject.put("appkey", paramString);
        int i1 = paramContext.getPackageManager().getPackageInfo(paramContext.getPackageName(), 0).versionCode;
        String str = paramContext.getPackageName();
        localJSONObject.put("version_code", i1);
        localJSONObject.put("package", str);
        localJSONObject.put("sdk_version", "3.2.1");
        localJSONObject.put("idmd5", t.d(paramContext));
        localJSONObject.put("channel", t.h(paramContext));
        this.d.post(new s(this, paramContext, localJSONObject));
        monitorexit;
        return;
      }
      catch (Exception localException)
      {
        while (true)
        {
          if (!(UmengConstants.testMode));
          Log.e("MobclickAgent", "exception in updateInternal");
          localException.printStackTrace();
        }
        localObject = finally;
        monitorexit;
        throw localObject;
      }
    }
  }

  /**
   * @deprecated
   */
  private void a(Context paramContext, String paramString1, String paramString2)
  {
    SharedPreferences localSharedPreferences;
    monitorenter;
    try
    {
      this.c = paramContext;
      localSharedPreferences = k(paramContext);
      if (localSharedPreferences == null);
    }
    finally
    {
      while (true)
      {
        String str1;
        do
        {
          String str2;
          monitorexit;
          throw localObject;
          str1 = a(paramContext, localSharedPreferences);
        }
        while (!(UmengConstants.testMode));
        Log.i("MobclickAgent", "Extend current session: " + str1);
      }
    }
  }

  /**
   * @deprecated
   */
  private void a(Context paramContext, String paramString1, String paramString2, String paramString3, int paramInt)
  {
    SharedPreferences localSharedPreferences;
    monitorenter;
    try
    {
      localSharedPreferences = k(paramContext);
      if (localSharedPreferences == null)
      {
        monitorexit;
        return;
      }
    }
    finally
    {
      monitorexit;
    }
  }

  private void a(Context paramContext, JSONObject paramJSONObject)
  {
    String str1;
    int i1;
    String str2;
    if (a("update", paramContext, new String[0]))
    {
      if (UmengConstants.testMode)
        Log.i("MobclickAgent", "start to check update info ...");
      str1 = null;
      i1 = 0;
      if (i1 >= UmengConstants.UPDATE_URL_LIST.length)
      {
        str2 = str1;
        if (str2 == null)
          break label118;
        c(paramContext, str2);
      }
    }
    while (true)
    {
      do
        while (true)
        {
          do
          {
            while (true)
            {
              while (true)
              {
                do
                {
                  return;
                  str1 = a(paramContext, paramJSONObject, UmengConstants.UPDATE_URL_LIST[i1], true, "update");
                  if (str1 == null)
                    break label112;
                }
                while (!(UmengConstants.testMode));
                Log.i("MobclickAgent", "get update info succeed: " + str1);
                str2 = str1;
              }
              label112: ++i1;
            }
            if (UmengConstants.testMode)
              label118: Log.i("MobclickAgent", "get update info failed");
          }
          while (i == null);
          i.onUpdateReturned(UpdateStatus.Timeout);
        }
      while (i == null);
      i.onUpdateReturned(UpdateStatus.No);
    }
  }

  private boolean a(SharedPreferences paramSharedPreferences)
  {
    int i1;
    long l1 = paramSharedPreferences.getLong("end_millis", -1L);
    if (System.currentTimeMillis() - l1 > UmengConstants.kContinueSessionMillis)
      i1 = 1;
    while (true)
    {
      return i1;
      i1 = 0;
    }
  }

  private static boolean a(String paramString, Context paramContext, String[] paramArrayOfString)
  {
    boolean bool;
    if ((paramContext.getPackageManager().checkPermission("android.permission.ACCESS_NETWORK_STATE", paramContext.getPackageName()) == 0) && (!(t.i(paramContext))))
      bool = false;
    while (true)
    {
      while (true)
      {
        while (true)
        {
          while (true)
          {
            while (true)
            {
              while (true)
              {
                while (true)
                {
                  while (true)
                  {
                    while (true)
                    {
                      while (true)
                      {
                        while (true)
                        {
                          return bool;
                          if ((paramString != "update") && (paramString != "online_config"))
                            break;
                          bool = true;
                        }
                        b = o(paramContext);
                        if (b != 3)
                          break;
                        if (paramString != "flush")
                          break label226;
                        bool = true;
                      }
                      if (paramString != "error")
                        break label106;
                      if ((paramArrayOfString == null) || (paramArrayOfString.length <= 0) || (!(paramArrayOfString[0].equals("send_error"))))
                        break;
                      bool = false;
                    }
                    bool = true;
                  }
                  label106: if ((b != 1) || (paramString != "launch"))
                    break;
                  bool = true;
                }
                if ((b != 2) || (paramString != "terminate"))
                  break;
                bool = true;
              }
              if (b != 0)
                break;
              bool = true;
            }
            if (b != 4)
              break label203;
            if ((!(j(paramContext).getString(t.b(), "false").equals("true"))) && (paramString.equals("launch")))
              break;
            bool = false;
          }
          bool = true;
        }
        label203: if (b != 5)
          break;
        bool = t.g(paramContext)[0].equals("Wi-Fi");
      }
      label226: bool = false;
    }
  }

  private static AlertDialog b(Context paramContext, JSONObject paramJSONObject)
  {
    AlertDialog localAlertDialog;
    String str1;
    String str2;
    try
    {
      if (paramJSONObject.has("version"))
      {
        String str3;
        str1 = paramJSONObject.getString("version");
        if (!(paramJSONObject.has("update_log")))
          break label302;
        str2 = paramJSONObject.getString("update_log");
        if (paramJSONObject.has("path"))
        {
          str3 = paramJSONObject.getString("path");
          String str4 = "";
          if (!(t.g(paramContext)[0].equals("Wi-Fi")))
            str4 = paramContext.getString(t.a(paramContext, "string", "UMGprsCondition")) + "\n";
          AlertDialog.Builder localBuilder = new AlertDialog.Builder(paramContext);
          localBuilder.setTitle(paramContext.getString(t.a(paramContext, "string", "UMUpdateTitle"))).setMessage(str4 + paramContext.getString(t.a(paramContext, "string", "UMNewVersion")) + str1 + "\n" + str2).setCancelable(false).setPositiveButton(paramContext.getString(t.a(paramContext, "string", "UMUpdateNow")), new l(paramContext, str3, str1)).setNegativeButton(paramContext.getString(t.a(paramContext, "string", "UMNotNow")), new m());
          localAlertDialog = localBuilder.create();
          localAlertDialog.setCancelable(true);
        }
        else
        {
          str3 = "";
        }
      }
    }
    catch (Exception localException)
    {
      while (true)
      {
        while (true)
        {
          if (UmengConstants.testMode)
          {
            Log.e("MobclickAgent", "Fail to create update dialog box.", localException);
            localException.printStackTrace();
          }
          localAlertDialog = null;
          return localAlertDialog;
          str1 = "";
        }
        label302: str2 = "";
      }
    }
  }

  private static String b()
  {
    return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
  }

  private void b(Context paramContext, SharedPreferences paramSharedPreferences)
  {
    String str1 = paramSharedPreferences.getString("session_id", null);
    if (str1 == null)
    {
      if (UmengConstants.testMode)
        Log.i("MobclickAgent", "Missing session_id, ignore message");
      return;
    }
    String str2 = b();
    String str3 = str2.split(" ")[0];
    String str4 = str2.split(" ")[1];
    JSONObject localJSONObject = new JSONObject();
    try
    {
      localJSONObject.put("type", "launch");
      localJSONObject.put("session_id", str1);
      localJSONObject.put("date", str3);
      localJSONObject.put("time", str4);
      this.d.post(new s(this, paramContext, localJSONObject));
    }
    catch (JSONException localJSONException)
    {
      if (!(UmengConstants.testMode));
      Log.e("MobclickAgent", "json error in emitNewSessionReport");
      localJSONException.printStackTrace();
    }
  }

  /**
   * @deprecated
   */
  private void b(Context paramContext, String paramString)
  {
    String str;
    monitorenter;
    try
    {
      str = c(paramContext);
      if (str != "")
      {
        int i1 = str.length();
        if (i1 <= 10240)
          break label33;
      }
      monitorexit;
      label33: return;
    }
    finally
    {
      monitorexit;
    }
  }

  private void b(Context paramContext, String paramString1, String paramString2)
  {
    String str1 = b();
    String str2 = str1.split(" ")[0];
    String str3 = str1.split(" ")[1];
    JSONObject localJSONObject = new JSONObject();
    try
    {
      localJSONObject.put("type", "error");
      localJSONObject.put("context", paramString1);
      localJSONObject.put("date", str2);
      localJSONObject.put("time", str3);
      localJSONObject.put("subtype", paramString2);
      this.d.post(new s(this, paramContext, localJSONObject));
      return;
    }
    catch (JSONException localJSONException)
    {
      if (!(UmengConstants.testMode));
      Log.i("MobclickAgent", "json error in emitErrorReport");
      localJSONException.printStackTrace();
    }
  }

  private static String c(Context paramContext)
  {
    String str1;
    BufferedReader localBufferedReader;
    int i1;
    String str3;
    Object localObject3;
    int i2;
    Object localObject1 = "";
    try
    {
      str1 = paramContext.getPackageName();
      ArrayList localArrayList = new ArrayList();
      localArrayList.add("logcat");
      localArrayList.add("-d");
      localArrayList.add("-v");
      localArrayList.add("raw");
      localArrayList.add("-s");
      localArrayList.add("AndroidRuntime:E");
      localArrayList.add("-p");
      localArrayList.add(str1);
      localBufferedReader = new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec((String[])localArrayList.toArray(new String[localArrayList.size()])).getInputStream()), 1024);
      String str2 = localBufferedReader.readLine();
      i1 = 0;
      str3 = "";
      localObject3 = str2;
      i2 = 0;
      if (localObject3 == null)
      {
        int i4 = str3.length();
        label344: if ((i4 > 0) && (i2 != 0) && (i1 != 0))
          localObject1 = str3;
      }
    }
    catch (Exception localException2)
    {
      try
      {
        Runtime.getRuntime().exec("logcat -c");
        return localObject1;
      }
      catch (Exception localException2)
      {
        int i3;
        try
        {
          do
          {
            while (true)
            {
              if (((String)localObject3).indexOf("thread attach failed") < 0)
                str3 = str3 + ((String)localObject3) + '\n';
              if ((i2 == 0) && (((String)localObject3).toLowerCase().indexOf("exception") >= 0))
                i2 = 1;
              if ((i1 != 0) || (((String)localObject3).indexOf(str1) < 0))
                break label344;
              i3 = 1;
              String str4 = localBufferedReader.readLine();
              i1 = i3;
              localObject3 = str4;
            }
            localException2 = localException2;
          }
          while (!(UmengConstants.testMode));
          Log.e("MobclickAgent", "Failed to clear log in exec(logcat -c)");
          localException2.printStackTrace();
        }
        catch (Exception localException1)
        {
          while (true)
          {
            while (true)
            {
              Object localObject2 = localObject1;
              if (UmengConstants.testMode)
              {
                Log.e("MobclickAgent", "Failed to catch error log in catchLogError");
                localException1.printStackTrace();
              }
              localObject1 = localObject2;
            }
            i3 = i1;
          }
        }
      }
    }
  }

  // ERROR //
  private void c(Context paramContext, SharedPreferences paramSharedPreferences)
  {
    // Byte code:
    //   0: aload_2
    //   1: ldc 127
    //   3: aconst_null
    //   4: invokeinterface 245 3 0
    //   9: astore_3
    //   10: aload_3
    //   11: ifnonnull +19 -> 30
    //   14: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   17: ifeq +12 -> 29
    //   20: ldc 166
    //   22: ldc_w 819
    //   25: invokestatic 821	android/util/Log:w	(Ljava/lang/String;Ljava/lang/String;)I
    //   28: pop
    //   29: return
    //   30: aload_2
    //   31: ldc 17
    //   33: ldc2_w 236
    //   36: invokeinterface 641 4 0
    //   41: invokestatic 220	java/lang/Long:valueOf	(J)Ljava/lang/Long;
    //   44: astore 4
    //   46: aload 4
    //   48: invokevirtual 229	java/lang/Long:longValue	()J
    //   51: lconst_0
    //   52: lcmp
    //   53: ifgt +9 -> 62
    //   56: lconst_0
    //   57: invokestatic 220	java/lang/Long:valueOf	(J)Ljava/lang/Long;
    //   60: astore 4
    //   62: invokestatic 528	com/mobclick/android/MobclickAgent:b	()Ljava/lang/String;
    //   65: astore 5
    //   67: aload 5
    //   69: ldc_w 530
    //   72: invokevirtual 534	java/lang/String:split	(Ljava/lang/String;)[Ljava/lang/String;
    //   75: iconst_0
    //   76: aaload
    //   77: astore 6
    //   79: aload 5
    //   81: ldc_w 530
    //   84: invokevirtual 534	java/lang/String:split	(Ljava/lang/String;)[Ljava/lang/String;
    //   87: iconst_1
    //   88: aaload
    //   89: astore 7
    //   91: new 320	org/json/JSONObject
    //   94: dup
    //   95: invokespecial 535	org/json/JSONObject:<init>	()V
    //   98: astore 8
    //   100: aload 8
    //   102: ldc 84
    //   104: ldc 108
    //   106: invokevirtual 538	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   109: pop
    //   110: aload 8
    //   112: ldc 127
    //   114: aload_3
    //   115: invokevirtual 538	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   118: pop
    //   119: aload 8
    //   121: ldc 130
    //   123: aload 6
    //   125: invokevirtual 538	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   128: pop
    //   129: aload 8
    //   131: ldc 8
    //   133: aload 7
    //   135: invokevirtual 538	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   138: pop
    //   139: aload 8
    //   141: ldc 17
    //   143: aload 4
    //   145: invokevirtual 229	java/lang/Long:longValue	()J
    //   148: ldc2_w 822
    //   151: ldiv
    //   152: invokestatic 826	java/lang/String:valueOf	(J)Ljava/lang/String;
    //   155: invokevirtual 538	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   158: pop
    //   159: getstatic 829	com/mobclick/android/UmengConstants:ACTIVITY_DURATION_OPEN	Z
    //   162: ifeq +65 -> 227
    //   165: aload_2
    //   166: ldc 20
    //   168: ldc 149
    //   170: invokeinterface 245 3 0
    //   175: astore 17
    //   177: ldc 149
    //   179: aload 17
    //   181: invokevirtual 496	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   184: ifne +43 -> 227
    //   187: aload 17
    //   189: ldc_w 831
    //   192: invokevirtual 534	java/lang/String:split	(Ljava/lang/String;)[Ljava/lang/String;
    //   195: astore 18
    //   197: new 479	org/json/JSONArray
    //   200: dup
    //   201: invokespecial 832	org/json/JSONArray:<init>	()V
    //   204: astore 19
    //   206: iconst_0
    //   207: istore 20
    //   209: iload 20
    //   211: aload 18
    //   213: arraylength
    //   214: if_icmplt +35 -> 249
    //   217: aload 8
    //   219: ldc 20
    //   221: aload 19
    //   223: invokevirtual 538	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   226: pop
    //   227: aload_0
    //   228: getfield 183	com/mobclick/android/MobclickAgent:d	Landroid/os/Handler;
    //   231: new 540	com/mobclick/android/s
    //   234: dup
    //   235: aload_0
    //   236: aload_1
    //   237: aload 8
    //   239: invokespecial 543	com/mobclick/android/s:<init>	(Lcom/mobclick/android/MobclickAgent;Landroid/content/Context;Lorg/json/JSONObject;)V
    //   242: invokevirtual 547	android/os/Handler:post	(Ljava/lang/Runnable;)Z
    //   245: pop
    //   246: goto -217 -> 29
    //   249: aload 19
    //   251: new 479	org/json/JSONArray
    //   254: dup
    //   255: aload 18
    //   257: iload 20
    //   259: aaload
    //   260: invokespecial 833	org/json/JSONArray:<init>	(Ljava/lang/String;)V
    //   263: invokevirtual 486	org/json/JSONArray:put	(Ljava/lang/Object;)Lorg/json/JSONArray;
    //   266: pop
    //   267: iinc 20 1
    //   270: goto -61 -> 209
    //   273: astore 9
    //   275: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   278: ifeq -249 -> 29
    //   281: ldc 166
    //   283: ldc_w 835
    //   286: invokestatic 511	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;)I
    //   289: pop
    //   290: aload 9
    //   292: invokevirtual 550	org/json/JSONException:printStackTrace	()V
    //   295: goto -266 -> 29
    //
    // Exception table:
    //   from	to	target	type
    //   100	227	273	org/json/JSONException
    //   249	267	273	org/json/JSONException
  }

  private void c(Context paramContext, String paramString)
  {
    try
    {
      k = new JSONObject(paramString);
      if (!(k.getString("update").equals("Yes")))
      {
        if (i != null)
          i.onUpdateReturned(UpdateStatus.No);
      }
      else
      {
        if (i != null)
          i.onUpdateReturned(UpdateStatus.Yes);
        if (updateAutoPopup)
          showUpdateDialog(paramContext);
      }
    }
    catch (Exception localException)
    {
      if (UmengConstants.testMode)
      {
        Log.i("MobclickAgent", "show update dialog error");
        localException.printStackTrace();
      }
    }
  }

  // ERROR //
  private void c(Context paramContext, JSONObject paramJSONObject)
  {
    // Byte code:
    //   0: aload_1
    //   1: invokestatic 364	com/mobclick/android/MobclickAgent:i	(Landroid/content/Context;)Landroid/content/SharedPreferences;
    //   4: astore_3
    //   5: aload_1
    //   6: invokestatic 848	com/mobclick/android/t:f	(Landroid/content/Context;)Lorg/json/JSONObject;
    //   9: astore 4
    //   11: aload_3
    //   12: ldc_w 390
    //   15: lconst_0
    //   16: invokeinterface 641 4 0
    //   21: lstore 5
    //   23: lload 5
    //   25: lconst_0
    //   26: lcmp
    //   27: ifeq +14 -> 41
    //   30: aload 4
    //   32: ldc_w 390
    //   35: lload 5
    //   37: invokevirtual 851	org/json/JSONObject:put	(Ljava/lang/String;J)Lorg/json/JSONObject;
    //   40: pop
    //   41: aload_3
    //   42: invokeinterface 226 1 0
    //   47: ldc 23
    //   49: aload 4
    //   51: invokevirtual 321	org/json/JSONObject:toString	()Ljava/lang/String;
    //   54: invokeinterface 268 3 0
    //   59: invokeinterface 241 1 0
    //   64: pop
    //   65: aload_1
    //   66: invokestatic 853	com/mobclick/android/MobclickAgent:g	(Landroid/content/Context;)Lorg/json/JSONObject;
    //   69: astore 8
    //   71: new 320	org/json/JSONObject
    //   74: dup
    //   75: invokespecial 535	org/json/JSONObject:<init>	()V
    //   78: astore 9
    //   80: aload_2
    //   81: ldc 84
    //   83: invokevirtual 473	org/json/JSONObject:getString	(Ljava/lang/String;)Ljava/lang/String;
    //   86: astore 12
    //   88: aload 12
    //   90: ifnonnull +29 -> 119
    //   93: return
    //   94: astore 34
    //   96: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   99: ifeq -58 -> 41
    //   102: ldc 166
    //   104: ldc_w 855
    //   107: invokestatic 331	android/util/Log:i	(Ljava/lang/String;Ljava/lang/String;)I
    //   110: pop
    //   111: aload 34
    //   113: invokevirtual 550	org/json/JSONException:printStackTrace	()V
    //   116: goto -75 -> 41
    //   119: aload_2
    //   120: ldc 87
    //   122: invokevirtual 477	org/json/JSONObject:has	(Ljava/lang/String;)Z
    //   125: ifeq +377 -> 502
    //   128: aload_2
    //   129: ldc 87
    //   131: invokevirtual 858	org/json/JSONObject:remove	(Ljava/lang/String;)Ljava/lang/Object;
    //   134: checkcast 458	java/lang/String
    //   137: astore 13
    //   139: aload 12
    //   141: ldc 105
    //   143: if_acmpeq +51 -> 194
    //   146: aload_2
    //   147: ldc 84
    //   149: invokevirtual 858	org/json/JSONObject:remove	(Ljava/lang/String;)Ljava/lang/Object;
    //   152: pop
    //   153: aload 8
    //   155: ifnull +106 -> 261
    //   158: aload 8
    //   160: aload 12
    //   162: invokevirtual 861	org/json/JSONObject:isNull	(Ljava/lang/String;)Z
    //   165: ifeq +81 -> 246
    //   168: new 479	org/json/JSONArray
    //   171: dup
    //   172: invokespecial 832	org/json/JSONArray:<init>	()V
    //   175: astore 30
    //   177: aload 30
    //   179: aload_2
    //   180: invokevirtual 486	org/json/JSONArray:put	(Ljava/lang/Object;)Lorg/json/JSONArray;
    //   183: pop
    //   184: aload 8
    //   186: aload 12
    //   188: aload 30
    //   190: invokevirtual 538	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   193: pop
    //   194: aload 8
    //   196: ifnonnull +103 -> 299
    //   199: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   202: ifeq -109 -> 93
    //   205: ldc 166
    //   207: ldc_w 863
    //   210: invokestatic 821	android/util/Log:w	(Ljava/lang/String;Ljava/lang/String;)I
    //   213: pop
    //   214: goto -121 -> 93
    //   217: astore 10
    //   219: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   222: ifeq +17 -> 239
    //   225: ldc 166
    //   227: ldc_w 865
    //   230: invokestatic 511	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;)I
    //   233: pop
    //   234: aload 10
    //   236: invokevirtual 550	org/json/JSONException:printStackTrace	()V
    //   239: aload_1
    //   240: invokestatic 867	com/mobclick/android/MobclickAgent:h	(Landroid/content/Context;)V
    //   243: goto -150 -> 93
    //   246: aload 8
    //   248: aload 12
    //   250: invokevirtual 871	org/json/JSONObject:getJSONArray	(Ljava/lang/String;)Lorg/json/JSONArray;
    //   253: aload_2
    //   254: invokevirtual 486	org/json/JSONArray:put	(Ljava/lang/Object;)Lorg/json/JSONArray;
    //   257: pop
    //   258: goto -64 -> 194
    //   261: new 320	org/json/JSONObject
    //   264: dup
    //   265: invokespecial 535	org/json/JSONObject:<init>	()V
    //   268: astore 8
    //   270: new 479	org/json/JSONArray
    //   273: dup
    //   274: invokespecial 832	org/json/JSONArray:<init>	()V
    //   277: astore 27
    //   279: aload 27
    //   281: aload_2
    //   282: invokevirtual 486	org/json/JSONArray:put	(Ljava/lang/Object;)Lorg/json/JSONArray;
    //   285: pop
    //   286: aload 8
    //   288: aload 12
    //   290: aload 27
    //   292: invokevirtual 538	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   295: pop
    //   296: goto -102 -> 194
    //   299: aload 9
    //   301: ldc 23
    //   303: aload 4
    //   305: invokevirtual 538	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   308: pop
    //   309: aload 9
    //   311: ldc 124
    //   313: aload 8
    //   315: invokevirtual 538	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   318: pop
    //   319: iconst_1
    //   320: anewarray 458	java/lang/String
    //   323: astore 16
    //   325: aload 16
    //   327: iconst_0
    //   328: aload 13
    //   330: aastore
    //   331: aload 12
    //   333: aload_1
    //   334: aload 16
    //   336: invokestatic 595	com/mobclick/android/MobclickAgent:a	(Ljava/lang/String;Landroid/content/Context;[Ljava/lang/String;)Z
    //   339: ifeq +154 -> 493
    //   342: iconst_0
    //   343: istore 17
    //   345: aconst_null
    //   346: astore 18
    //   348: iload 17
    //   350: getstatic 874	com/mobclick/android/UmengConstants:APPLOG_URL_LIST	[Ljava/lang/String;
    //   353: arraylength
    //   354: if_icmplt +89 -> 443
    //   357: aload 18
    //   359: astore 19
    //   361: aload 19
    //   363: ifnull +115 -> 478
    //   366: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   369: ifeq +27 -> 396
    //   372: ldc 166
    //   374: new 192	java/lang/StringBuilder
    //   377: dup
    //   378: ldc_w 876
    //   381: invokespecial 195	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   384: aload 19
    //   386: invokevirtual 199	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   389: invokevirtual 202	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   392: invokestatic 331	android/util/Log:i	(Ljava/lang/String;Ljava/lang/String;)I
    //   395: pop
    //   396: aload_1
    //   397: invokestatic 867	com/mobclick/android/MobclickAgent:h	(Landroid/content/Context;)V
    //   400: getstatic 143	com/mobclick/android/MobclickAgent:b	I
    //   403: iconst_4
    //   404: if_icmpne -311 -> 93
    //   407: aload_1
    //   408: invokestatic 657	com/mobclick/android/MobclickAgent:j	(Landroid/content/Context;)Landroid/content/SharedPreferences;
    //   411: invokeinterface 226 1 0
    //   416: astore 21
    //   418: aload 21
    //   420: invokestatic 658	com/mobclick/android/t:b	()Ljava/lang/String;
    //   423: ldc_w 662
    //   426: invokeinterface 268 3 0
    //   431: pop
    //   432: aload 21
    //   434: invokeinterface 241 1 0
    //   439: pop
    //   440: goto -347 -> 93
    //   443: aload_1
    //   444: aload 9
    //   446: getstatic 874	com/mobclick/android/UmengConstants:APPLOG_URL_LIST	[Ljava/lang/String;
    //   449: iload 17
    //   451: aaload
    //   452: iconst_0
    //   453: aload 12
    //   455: invokestatic 605	com/mobclick/android/MobclickAgent:a	(Landroid/content/Context;Lorg/json/JSONObject;Ljava/lang/String;ZLjava/lang/String;)Ljava/lang/String;
    //   458: astore 18
    //   460: aload 18
    //   462: ifnull +10 -> 472
    //   465: aload 18
    //   467: astore 19
    //   469: goto -108 -> 361
    //   472: iinc 17 1
    //   475: goto -127 -> 348
    //   478: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   481: ifeq +12 -> 493
    //   484: ldc 166
    //   486: ldc_w 878
    //   489: invokestatic 331	android/util/Log:i	(Ljava/lang/String;Ljava/lang/String;)I
    //   492: pop
    //   493: aload_1
    //   494: aload 8
    //   496: invokestatic 880	com/mobclick/android/MobclickAgent:d	(Landroid/content/Context;Lorg/json/JSONObject;)V
    //   499: goto -406 -> 93
    //   502: aconst_null
    //   503: astore 13
    //   505: goto -366 -> 139
    //
    // Exception table:
    //   from	to	target	type
    //   30	41	94	org/json/JSONException
    //   80	88	217	org/json/JSONException
    //   119	214	217	org/json/JSONException
    //   246	319	217	org/json/JSONException
  }

  /**
   * @deprecated
   */
  private void d(Context paramContext)
  {
    monitorenter;
    try
    {
    }
    finally
    {
      while (true)
      {
        SharedPreferences localSharedPreferences;
        long l1;
        monitorexit;
        throw localObject;
        long l2 = System.currentTimeMillis();
        long l3 = l2 - l1;
        long l4 = localSharedPreferences.getLong("duration", 0L);
        SharedPreferences.Editor localEditor = localSharedPreferences.edit();
        if (UmengConstants.ACTIVITY_DURATION_OPEN)
        {
          String str1 = localSharedPreferences.getString("activities", "");
          String str2 = paramContext.getClass().getName();
          if (!("".equals(str1)))
            str1 = str1 + ";";
          String str3 = str1 + "[" + str2 + "," + (l3 / 1000L) + "]";
          localEditor.remove("activities");
          localEditor.putString("activities", str3);
        }
        localEditor.putLong("start_millis", -1L);
        localEditor.putLong("end_millis", l2);
        localEditor.putLong("duration", l3 + l4);
        localEditor.commit();
      }
    }
  }

  // ERROR //
  private static void d(Context paramContext, String paramString)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokestatic 513	com/mobclick/android/MobclickAgent:n	(Landroid/content/Context;)Landroid/content/SharedPreferences;
    //   4: astore_2
    //   5: getstatic 517	com/mobclick/android/UmengConstants:saveOnlineConfigMutex	Ljava/lang/Object;
    //   8: astore_3
    //   9: aload_3
    //   10: monitorenter
    //   11: new 320	org/json/JSONObject
    //   14: dup
    //   15: aload_1
    //   16: invokespecial 836	org/json/JSONObject:<init>	(Ljava/lang/String;)V
    //   19: astore 4
    //   21: aload 4
    //   23: ldc 55
    //   25: invokevirtual 477	org/json/JSONObject:has	(Ljava/lang/String;)Z
    //   28: ifeq +30 -> 58
    //   31: aload_2
    //   32: invokeinterface 226 1 0
    //   37: ldc_w 906
    //   40: aload 4
    //   42: ldc 55
    //   44: invokevirtual 473	org/json/JSONObject:getString	(Ljava/lang/String;)Ljava/lang/String;
    //   47: invokeinterface 268 3 0
    //   52: invokeinterface 241 1 0
    //   57: pop
    //   58: aload 4
    //   60: ldc 58
    //   62: invokevirtual 477	org/json/JSONObject:has	(Ljava/lang/String;)Z
    //   65: ifeq +30 -> 95
    //   68: aload_2
    //   69: invokeinterface 226 1 0
    //   74: ldc_w 908
    //   77: aload 4
    //   79: ldc 58
    //   81: invokevirtual 500	org/json/JSONObject:getInt	(Ljava/lang/String;)I
    //   84: invokeinterface 523 3 0
    //   89: invokeinterface 241 1 0
    //   94: pop
    //   95: aload 4
    //   97: ldc 61
    //   99: invokevirtual 477	org/json/JSONObject:has	(Ljava/lang/String;)Z
    //   102: ifeq +30 -> 132
    //   105: aload_2
    //   106: invokeinterface 226 1 0
    //   111: ldc_w 910
    //   114: aload 4
    //   116: ldc 61
    //   118: invokevirtual 500	org/json/JSONObject:getInt	(Ljava/lang/String;)I
    //   121: invokeinterface 523 3 0
    //   126: invokeinterface 241 1 0
    //   131: pop
    //   132: aload 4
    //   134: ldc 64
    //   136: invokevirtual 477	org/json/JSONObject:has	(Ljava/lang/String;)Z
    //   139: ifeq +92 -> 231
    //   142: new 320	org/json/JSONObject
    //   145: dup
    //   146: aload 4
    //   148: ldc 64
    //   150: invokevirtual 473	org/json/JSONObject:getString	(Ljava/lang/String;)Ljava/lang/String;
    //   153: invokespecial 836	org/json/JSONObject:<init>	(Ljava/lang/String;)V
    //   156: astore 10
    //   158: aload 10
    //   160: invokevirtual 914	org/json/JSONObject:keys	()Ljava/util/Iterator;
    //   163: astore 11
    //   165: aload_2
    //   166: invokeinterface 226 1 0
    //   171: astore 12
    //   173: aload 11
    //   175: invokeinterface 919 1 0
    //   180: ifne +133 -> 313
    //   183: aload 12
    //   185: invokeinterface 241 1 0
    //   190: pop
    //   191: getstatic 147	com/mobclick/android/MobclickAgent:j	Lcom/mobclick/android/UmengOnlineConfigureListener;
    //   194: ifnull +13 -> 207
    //   197: getstatic 147	com/mobclick/android/MobclickAgent:j	Lcom/mobclick/android/UmengOnlineConfigureListener;
    //   200: aload 10
    //   202: invokeinterface 925 2 0
    //   207: ldc 166
    //   209: new 192	java/lang/StringBuilder
    //   212: dup
    //   213: ldc_w 927
    //   216: invokespecial 195	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   219: aload 10
    //   221: invokevirtual 930	java/lang/StringBuilder:append	(Ljava/lang/Object;)Ljava/lang/StringBuilder;
    //   224: invokevirtual 202	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   227: invokestatic 331	android/util/Log:i	(Ljava/lang/String;Ljava/lang/String;)I
    //   230: pop
    //   231: aload_3
    //   232: monitorexit
    //   233: goto +128 -> 361
    //   236: astore 20
    //   238: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   241: ifeq +12 -> 253
    //   244: ldc 166
    //   246: ldc_w 932
    //   249: invokestatic 331	android/util/Log:i	(Ljava/lang/String;Ljava/lang/String;)I
    //   252: pop
    //   253: aload_3
    //   254: monitorexit
    //   255: goto +106 -> 361
    //   258: astore 9
    //   260: aload_3
    //   261: monitorexit
    //   262: aload 9
    //   264: athrow
    //   265: astore 5
    //   267: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   270: ifeq -212 -> 58
    //   273: aload 5
    //   275: invokevirtual 506	java/lang/Exception:printStackTrace	()V
    //   278: goto -220 -> 58
    //   281: astore 6
    //   283: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   286: ifeq -191 -> 95
    //   289: aload 6
    //   291: invokevirtual 506	java/lang/Exception:printStackTrace	()V
    //   294: goto -199 -> 95
    //   297: astore 7
    //   299: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   302: ifeq -170 -> 132
    //   305: aload 7
    //   307: invokevirtual 506	java/lang/Exception:printStackTrace	()V
    //   310: goto -178 -> 132
    //   313: aload 11
    //   315: invokeinterface 936 1 0
    //   320: checkcast 458	java/lang/String
    //   323: astore 13
    //   325: aload 12
    //   327: aload 13
    //   329: aload 10
    //   331: aload 13
    //   333: invokevirtual 473	org/json/JSONObject:getString	(Ljava/lang/String;)Ljava/lang/String;
    //   336: invokeinterface 268 3 0
    //   341: pop
    //   342: goto -169 -> 173
    //   345: astore 8
    //   347: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   350: ifeq -119 -> 231
    //   353: aload 8
    //   355: invokevirtual 506	java/lang/Exception:printStackTrace	()V
    //   358: goto -127 -> 231
    //   361: return
    //
    // Exception table:
    //   from	to	target	type
    //   11	21	236	java/lang/Exception
    //   11	21	258	finally
    //   21	58	258	finally
    //   58	95	258	finally
    //   95	132	258	finally
    //   132	231	258	finally
    //   231	262	258	finally
    //   267	310	258	finally
    //   313	342	258	finally
    //   347	358	258	finally
    //   21	58	265	java/lang/Exception
    //   58	95	281	java/lang/Exception
    //   95	132	297	java/lang/Exception
    //   132	231	345	java/lang/Exception
    //   313	342	345	java/lang/Exception
  }

  private static void d(Context paramContext, JSONObject paramJSONObject)
  {
    String str = m(paramContext);
    try
    {
      FileOutputStream localFileOutputStream = paramContext.openFileOutput(str, 0);
      localFileOutputStream.write(paramJSONObject.toString().getBytes());
      localFileOutputStream.close();
      return;
    }
    catch (FileNotFoundException localFileNotFoundException)
    {
      if (!(UmengConstants.testMode));
      localFileNotFoundException.printStackTrace();
    }
    catch (IOException localIOException)
    {
      if (!(UmengConstants.testMode));
      localIOException.printStackTrace();
    }
  }

  /**
   * @deprecated
   */
  private void e(Context paramContext)
  {
    monitorenter;
    try
    {
      f(paramContext);
      monitorexit;
      return;
    }
    finally
    {
      localObject = finally;
      monitorexit;
      throw localObject;
    }
  }

  /**
   * @deprecated
   */
  private void e(Context paramContext, String paramString)
  {
    JSONObject localJSONObject;
    monitorenter;
    try
    {
      localJSONObject = new JSONObject();
    }
    finally
    {
      try
      {
        localJSONObject.put("type", "online_config");
        localJSONObject.put("appkey", paramString);
        int i1 = paramContext.getPackageManager().getPackageInfo(paramContext.getPackageName(), 0).versionCode;
        String str = paramContext.getPackageName();
        localJSONObject.put("version_code", i1);
        localJSONObject.put("package", str);
        localJSONObject.put("sdk_version", "3.2.1");
        localJSONObject.put("idmd5", t.d(paramContext));
        localJSONObject.put("channel", t.h(paramContext));
        localJSONObject.put("report_policy", o(paramContext));
        localJSONObject.put("last_config_time", p(paramContext));
        this.d.post(new s(this, paramContext, localJSONObject));
        monitorexit;
        return;
      }
      catch (Exception localException)
      {
        while (true)
        {
          if (!(UmengConstants.testMode));
          Log.e("MobclickAgent", "exception in onlineConfigInternal");
        }
        localObject = finally;
        monitorexit;
        throw localObject;
      }
    }
  }

  private void e(Context paramContext, JSONObject paramJSONObject)
  {
    if (a("online_config", paramContext, new String[0]))
    {
      if (UmengConstants.testMode)
        Log.i("MobclickAgent", "start to check onlineConfig info ...");
      String str = a(paramContext, paramJSONObject, "http://www.umeng.com/check_config_update", true, "online_config");
      if (str == null)
        str = a(paramContext, paramJSONObject, "http://www.umeng.co/check_config_update", true, "online_config");
      if (str == null)
        break label81;
      if (UmengConstants.testMode)
        Log.i("MobclickAgent", "get onlineConfig info succeed !");
      d(paramContext, str);
    }
    while (true)
    {
      label81: 
      do
        return;
      while (!(UmengConstants.testMode));
      Log.i("MobclickAgent", "get onlineConfig info failed !");
    }
  }

  public static void enterPage(Context paramContext, String paramString)
  {
    onEvent(paramContext, "_PAGE_", paramString);
  }

  private void f(Context paramContext)
  {
    JSONObject localJSONObject = new JSONObject();
    try
    {
      localJSONObject.put("type", "flush");
      this.d.post(new s(this, paramContext, localJSONObject));
      return;
    }
    catch (JSONException localJSONException)
    {
      if (!(UmengConstants.testMode));
      Log.e("MobclickAgent", "json error in emitCache");
    }
  }

  public static void flush(Context paramContext)
  {
    if (paramContext == null);
    try
    {
      if (UmengConstants.testMode)
        Log.e("MobclickAgent", "unexpected null context in flush");
      a.e(paramContext);
      return;
    }
    catch (Exception localException)
    {
      if (!(UmengConstants.testMode));
      Log.e("MobclickAgent", "Exception occurred in Mobclick.flush(). ");
      localException.printStackTrace();
    }
  }

  // ERROR //
  private static JSONObject g(Context paramContext)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokestatic 940	com/mobclick/android/MobclickAgent:m	(Landroid/content/Context;)Ljava/lang/String;
    //   4: astore_1
    //   5: aload_0
    //   6: aload_1
    //   7: invokevirtual 991	android/content/Context:openFileInput	(Ljava/lang/String;)Ljava/io/FileInputStream;
    //   10: astore 5
    //   12: ldc 149
    //   14: astore 6
    //   16: sipush 16384
    //   19: newarray byte
    //   21: astore 7
    //   23: aload 5
    //   25: aload 7
    //   27: invokevirtual 997	java/io/FileInputStream:read	([B)I
    //   30: istore 8
    //   32: iload 8
    //   34: bipush 255
    //   36: if_icmpne +16 -> 52
    //   39: aload 6
    //   41: invokevirtual 750	java/lang/String:length	()I
    //   44: ifne +47 -> 91
    //   47: aconst_null
    //   48: astore_3
    //   49: goto +90 -> 139
    //   52: new 192	java/lang/StringBuilder
    //   55: dup
    //   56: aload 6
    //   58: invokestatic 461	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   61: invokespecial 195	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   64: new 458	java/lang/String
    //   67: dup
    //   68: aload 7
    //   70: iconst_0
    //   71: iload 8
    //   73: invokespecial 1000	java/lang/String:<init>	([BII)V
    //   76: invokevirtual 199	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   79: invokevirtual 202	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   82: astore 9
    //   84: aload 9
    //   86: astore 6
    //   88: goto -65 -> 23
    //   91: new 320	org/json/JSONObject
    //   94: dup
    //   95: aload 6
    //   97: invokespecial 836	org/json/JSONObject:<init>	(Ljava/lang/String;)V
    //   100: astore 10
    //   102: aload 10
    //   104: astore_3
    //   105: goto +34 -> 139
    //   108: astore 11
    //   110: aload 5
    //   112: invokevirtual 1001	java/io/FileInputStream:close	()V
    //   115: aload_0
    //   116: invokestatic 867	com/mobclick/android/MobclickAgent:h	(Landroid/content/Context;)V
    //   119: aload 11
    //   121: invokevirtual 550	org/json/JSONException:printStackTrace	()V
    //   124: aconst_null
    //   125: astore_3
    //   126: goto +13 -> 139
    //   129: astore 4
    //   131: aconst_null
    //   132: astore_3
    //   133: goto +6 -> 139
    //   136: astore_2
    //   137: aconst_null
    //   138: astore_3
    //   139: aload_3
    //   140: areturn
    //
    // Exception table:
    //   from	to	target	type
    //   91	102	108	org/json/JSONException
    //   5	84	129	java/io/FileNotFoundException
    //   91	102	129	java/io/FileNotFoundException
    //   110	124	129	java/io/FileNotFoundException
    //   5	84	136	java/io/IOException
    //   91	102	136	java/io/IOException
    //   110	124	136	java/io/IOException
  }

  public static String getConfigParams(Context paramContext, String paramString)
  {
    return n(paramContext).getString(paramString, "");
  }

  public static JSONObject getUpdateInfo()
  {
    return k;
  }

  private static void h(Context paramContext)
  {
    paramContext.deleteFile(l(paramContext));
    paramContext.deleteFile(m(paramContext));
  }

  private static SharedPreferences i(Context paramContext)
  {
    String str = paramContext.getPackageName();
    return paramContext.getSharedPreferences("mobclick_agent_header_" + str, 0);
  }

  public static boolean isDownloadingAPK()
  {
    return f.b();
  }

  private static SharedPreferences j(Context paramContext)
  {
    String str = paramContext.getPackageName();
    return paramContext.getSharedPreferences("mobclick_agent_update_" + str, 0);
  }

  private static SharedPreferences k(Context paramContext)
  {
    String str = paramContext.getPackageName();
    return paramContext.getSharedPreferences("mobclick_agent_state_" + str, 0);
  }

  private static String l(Context paramContext)
  {
    String str = paramContext.getPackageName();
    return "mobclick_agent_header_" + str;
  }

  private static String m(Context paramContext)
  {
    String str = paramContext.getPackageName();
    return "mobclick_agent_cached_" + str;
  }

  private static SharedPreferences n(Context paramContext)
  {
    String str = paramContext.getPackageName();
    return paramContext.getSharedPreferences("mobclick_agent_online_setting_" + str, 0);
  }

  private static int o(Context paramContext)
  {
    int i1;
    SharedPreferences localSharedPreferences = n(paramContext);
    if ((localSharedPreferences.contains("umeng_net_report_policy")) && (localSharedPreferences.getInt("umeng_net_report_policy", -1) != -1))
      i1 = localSharedPreferences.getInt("umeng_net_report_policy", b);
    while (true)
    {
      return i1;
      i1 = localSharedPreferences.getInt("umeng_local_report_policy", b);
    }
  }

  // ERROR //
  public static void onError(Context paramContext)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokestatic 1034	com/mobclick/android/t:b	(Landroid/content/Context;)Ljava/lang/String;
    //   4: astore_3
    //   5: aload_3
    //   6: ifnull +10 -> 16
    //   9: aload_3
    //   10: invokevirtual 750	java/lang/String:length	()I
    //   13: ifne +21 -> 34
    //   16: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   19: ifeq +73 -> 92
    //   22: ldc 166
    //   24: ldc_w 1036
    //   27: invokestatic 511	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;)I
    //   30: pop
    //   31: goto +61 -> 92
    //   34: aload_0
    //   35: ifnonnull +44 -> 79
    //   38: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   41: ifeq +51 -> 92
    //   44: ldc 166
    //   46: ldc_w 1038
    //   49: invokestatic 511	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;)I
    //   52: pop
    //   53: goto +39 -> 92
    //   56: astore_1
    //   57: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   60: ifeq +32 -> 92
    //   63: ldc 166
    //   65: ldc_w 1040
    //   68: invokestatic 511	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;)I
    //   71: pop
    //   72: aload_1
    //   73: invokevirtual 506	java/lang/Exception:printStackTrace	()V
    //   76: goto +16 -> 92
    //   79: new 1042	com/mobclick/android/r
    //   82: dup
    //   83: aload_0
    //   84: aload_3
    //   85: iconst_2
    //   86: invokespecial 1045	com/mobclick/android/r:<init>	(Landroid/content/Context;Ljava/lang/String;I)V
    //   89: invokevirtual 1046	com/mobclick/android/r:start	()V
    //   92: return
    //
    // Exception table:
    //   from	to	target	type
    //   0	53	56	java/lang/Exception
    //   79	92	56	java/lang/Exception
  }

  public static void onEvent(Context paramContext, String paramString)
  {
    onEvent(paramContext, paramString, 1);
  }

  public static void onEvent(Context paramContext, String paramString, int paramInt)
  {
    onEvent(paramContext, paramString, null, paramInt);
  }

  public static void onEvent(Context paramContext, String paramString1, String paramString2)
  {
    if ((paramString2 == null) || (paramString2 == ""))
      if (UmengConstants.testMode)
        Log.e("MobclickAgent", "label is null or empty in onEvent(4p)");
    while (true)
    {
      return;
      onEvent(paramContext, paramString1, paramString2, 1);
    }
  }

  // ERROR //
  public static void onEvent(Context paramContext, String paramString1, String paramString2, int paramInt)
  {
    // Byte code:
    //   0: aload_0
    //   1: invokestatic 1034	com/mobclick/android/t:b	(Landroid/content/Context;)Ljava/lang/String;
    //   4: astore 6
    //   6: aload 6
    //   8: ifnull +11 -> 19
    //   11: aload 6
    //   13: invokevirtual 750	java/lang/String:length	()I
    //   16: ifne +21 -> 37
    //   19: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   22: ifeq +129 -> 151
    //   25: ldc 166
    //   27: ldc_w 1055
    //   30: invokestatic 511	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;)I
    //   33: pop
    //   34: goto +117 -> 151
    //   37: aload_0
    //   38: ifnonnull +46 -> 84
    //   41: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   44: ifeq +107 -> 151
    //   47: ldc 166
    //   49: ldc_w 1057
    //   52: invokestatic 511	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;)I
    //   55: pop
    //   56: goto +95 -> 151
    //   59: astore 4
    //   61: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   64: ifeq +87 -> 151
    //   67: ldc 166
    //   69: ldc_w 1059
    //   72: invokestatic 511	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;)I
    //   75: pop
    //   76: aload 4
    //   78: invokevirtual 506	java/lang/Exception:printStackTrace	()V
    //   81: goto +70 -> 151
    //   84: aload_1
    //   85: ifnull +9 -> 94
    //   88: aload_1
    //   89: ldc 149
    //   91: if_acmpne +21 -> 112
    //   94: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   97: ifeq +54 -> 151
    //   100: ldc 166
    //   102: ldc_w 1061
    //   105: invokestatic 511	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;)I
    //   108: pop
    //   109: goto +42 -> 151
    //   112: iload_3
    //   113: ifgt +21 -> 134
    //   116: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   119: ifeq +32 -> 151
    //   122: ldc 166
    //   124: ldc_w 1063
    //   127: invokestatic 511	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;)I
    //   130: pop
    //   131: goto +20 -> 151
    //   134: new 1042	com/mobclick/android/r
    //   137: dup
    //   138: aload_0
    //   139: aload 6
    //   141: aload_1
    //   142: aload_2
    //   143: iload_3
    //   144: iconst_3
    //   145: invokespecial 1066	com/mobclick/android/r:<init>	(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;II)V
    //   148: invokevirtual 1046	com/mobclick/android/r:start	()V
    //   151: return
    //
    // Exception table:
    //   from	to	target	type
    //   0	56	59	java/lang/Exception
    //   88	151	59	java/lang/Exception
  }

  public static void onPause(Context paramContext)
  {
    if (paramContext == null);
    try
    {
      if (UmengConstants.testMode)
      {
        Log.e("MobclickAgent", "unexpected null context in onPause");
        return;
        new r(paramContext, 0).start();
      }
    }
    catch (Exception localException)
    {
      if (UmengConstants.testMode)
      {
        Log.e("MobclickAgent", "Exception occurred in Mobclick.onRause(). ");
        localException.printStackTrace();
      }
    }
  }

  public static void onResume(Context paramContext)
  {
    onResume(paramContext, t.b(paramContext), t.h(paramContext));
  }

  // ERROR //
  public static void onResume(Context paramContext, String paramString1, String paramString2)
  {
    // Byte code:
    //   0: aload_2
    //   1: putstatic 1078	com/mobclick/android/UmengConstants:channel	Ljava/lang/String;
    //   4: aload_0
    //   5: ifnonnull +21 -> 26
    //   8: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   11: ifeq +81 -> 92
    //   14: ldc 166
    //   16: ldc_w 1080
    //   19: invokestatic 511	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;)I
    //   22: pop
    //   23: goto +69 -> 92
    //   26: aload_1
    //   27: ifnull +10 -> 37
    //   30: aload_1
    //   31: invokevirtual 750	java/lang/String:length	()I
    //   34: ifne +44 -> 78
    //   37: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   40: ifeq +52 -> 92
    //   43: ldc 166
    //   45: ldc_w 1082
    //   48: invokestatic 511	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;)I
    //   51: pop
    //   52: goto +40 -> 92
    //   55: astore_3
    //   56: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   59: ifeq +33 -> 92
    //   62: ldc 166
    //   64: ldc_w 1084
    //   67: invokestatic 511	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;)I
    //   70: pop
    //   71: aload_3
    //   72: invokevirtual 506	java/lang/Exception:printStackTrace	()V
    //   75: goto +17 -> 92
    //   78: new 1042	com/mobclick/android/r
    //   81: dup
    //   82: aload_0
    //   83: aload_1
    //   84: aload_2
    //   85: iconst_1
    //   86: invokespecial 1086	com/mobclick/android/r:<init>	(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;I)V
    //   89: invokevirtual 1046	com/mobclick/android/r:start	()V
    //   92: return
    //
    // Exception table:
    //   from	to	target	type
    //   0	52	55	java/lang/Exception
    //   78	92	55	java/lang/Exception
  }

  public static void openActivityDurationTrack(boolean paramBoolean)
  {
    UmengConstants.ACTIVITY_DURATION_OPEN = paramBoolean;
  }

  private static String p(Context paramContext)
  {
    return n(paramContext).getString("umeng_last_config_time", "");
  }

  public static void reportError(Context paramContext, String paramString)
  {
    if ((paramString == null) || (paramString == "") || (paramString.length() > 10240));
    while (true)
    {
      while (true)
      {
        do
        {
          return;
          if (paramContext != null)
            break label43;
        }
        while (!(UmengConstants.testMode));
        Log.e("MobclickAgent", "unexpected null context in reportError");
      }
      label43: a.b(paramContext, paramString, "send_error");
    }
  }

  public static void setAge(Context paramContext, int paramInt)
  {
    new o(paramContext, paramInt).start();
  }

  public static void setAutoLocation(boolean paramBoolean)
  {
    mUseLocationService = paramBoolean;
  }

  public static void setDebugMode(boolean paramBoolean)
  {
    UmengConstants.testMode = paramBoolean;
  }

  public static void setDefaultReportPolicy(Context paramContext, int paramInt)
  {
    if ((paramInt < 0) || (paramInt > 5))
      if (UmengConstants.testMode)
        Log.e("MobclickAgent", "Illegal value of report policy");
    while (true)
    {
      return;
      b = paramInt;
      a(paramContext, paramInt);
    }
  }

  public static void setGender(Context paramContext, Gender paramGender)
  {
    new n(paramContext, paramGender).start();
  }

  public static void setOnlineConfigureListener(UmengOnlineConfigureListener paramUmengOnlineConfigureListener)
  {
    j = paramUmengOnlineConfigureListener;
  }

  public static void setOpenGLContext(GL10 paramGL10)
  {
    if (paramGL10 != null)
    {
      String[] arrayOfString = t.a(paramGL10);
      if (arrayOfString.length == 2)
      {
        GPU_VENDER = arrayOfString[0];
        GPU_RENDERER = arrayOfString[1];
      }
    }
  }

  public static void setSessionContinueMillis(long paramLong)
  {
    UmengConstants.kContinueSessionMillis = paramLong;
  }

  public static void setUpdateListener(UmengUpdateListener paramUmengUpdateListener)
  {
    i = paramUmengUpdateListener;
  }

  public static void setUpdateOnlyWifi(boolean paramBoolean)
  {
    mUpdateOnlyWifi = paramBoolean;
  }

  public static void setUserID(Context paramContext, String paramString1, String paramString2)
  {
    new p(paramContext, paramString1, paramString2).start();
  }

  public static void showUpdateDialog(Context paramContext)
  {
    if ((k != null) && (k.has("update")) && (k.optString("update").toLowerCase().equals("yes")))
      b(paramContext, k).show();
  }

  // ERROR //
  public static void update(Context paramContext)
  {
    // Byte code:
    //   0: invokestatic 1017	com/mobclick/android/f:b	()Z
    //   3: ifeq +10 -> 13
    //   6: aload_0
    //   7: invokestatic 1136	com/mobclick/android/t:a	(Landroid/content/Context;)V
    //   10: goto +134 -> 144
    //   13: getstatic 155	com/mobclick/android/MobclickAgent:mUpdateOnlyWifi	Z
    //   16: ifeq +78 -> 94
    //   19: aload_0
    //   20: invokestatic 665	com/mobclick/android/t:g	(Landroid/content/Context;)[Ljava/lang/String;
    //   23: iconst_0
    //   24: aaload
    //   25: ldc_w 667
    //   28: invokevirtual 496	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   31: ifne +63 -> 94
    //   34: getstatic 145	com/mobclick/android/MobclickAgent:i	Lcom/mobclick/android/UmengUpdateListener;
    //   37: ifnull +107 -> 144
    //   40: getstatic 145	com/mobclick/android/MobclickAgent:i	Lcom/mobclick/android/UmengUpdateListener;
    //   43: getstatic 1139	com/mobclick/android/UpdateStatus:NoneWifi	I
    //   46: invokeinterface 619 2 0
    //   51: goto +93 -> 144
    //   54: astore_1
    //   55: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   58: ifeq +86 -> 144
    //   61: ldc 166
    //   63: new 192	java/lang/StringBuilder
    //   66: dup
    //   67: ldc_w 1141
    //   70: invokespecial 195	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   73: aload_1
    //   74: invokevirtual 1144	java/lang/Exception:getMessage	()Ljava/lang/String;
    //   77: invokevirtual 199	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   80: invokevirtual 202	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   83: invokestatic 511	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;)I
    //   86: pop
    //   87: aload_1
    //   88: invokevirtual 506	java/lang/Exception:printStackTrace	()V
    //   91: goto +53 -> 144
    //   94: aload_0
    //   95: ifnonnull +38 -> 133
    //   98: getstatic 145	com/mobclick/android/MobclickAgent:i	Lcom/mobclick/android/UmengUpdateListener;
    //   101: ifnull +14 -> 115
    //   104: getstatic 145	com/mobclick/android/MobclickAgent:i	Lcom/mobclick/android/UmengUpdateListener;
    //   107: getstatic 622	com/mobclick/android/UpdateStatus:No	I
    //   110: invokeinterface 619 2 0
    //   115: getstatic 326	com/mobclick/android/UmengConstants:testMode	Z
    //   118: ifeq +26 -> 144
    //   121: ldc 166
    //   123: ldc_w 1146
    //   126: invokestatic 511	android/util/Log:e	(Ljava/lang/String;Ljava/lang/String;)I
    //   129: pop
    //   130: goto +14 -> 144
    //   133: getstatic 141	com/mobclick/android/MobclickAgent:a	Lcom/mobclick/android/MobclickAgent;
    //   136: aload_0
    //   137: aload_0
    //   138: invokestatic 1034	com/mobclick/android/t:b	(Landroid/content/Context;)Ljava/lang/String;
    //   141: invokespecial 1148	com/mobclick/android/MobclickAgent:a	(Landroid/content/Context;Ljava/lang/String;)V
    //   144: return
    //
    // Exception table:
    //   from	to	target	type
    //   0	51	54	java/lang/Exception
    //   98	144	54	java/lang/Exception
  }

  public static void update(Context paramContext, long paramLong)
  {
    if (paramContext == null)
      if (UmengConstants.testMode)
        Log.i("MobclickAgent", "unexpected null Context");
    while (true)
    {
      return;
      new q(paramContext, paramLong).start();
    }
  }

  public static void update(Context paramContext, String paramString)
  {
    UmengConstants.channel = paramString;
    update(paramContext);
  }

  public static void updateOnlineConfig(Context paramContext)
  {
    if (paramContext == null);
    try
    {
      Log.e("MobclickAgent", "unexpected null context in updateOnlineConfig");
      return;
      a.e(paramContext, t.b(paramContext));
    }
    catch (Exception localException)
    {
      if (UmengConstants.testMode)
        Log.e("MobclickAgent", "exception in updateOnlineConfig");
    }
  }

  public static void updateOnlineConfig(Context paramContext, String paramString)
  {
    UmengConstants.channel = paramString;
    updateOnlineConfig(paramContext);
  }
}